#ifndef CEVENTSYSTEM_H_
#define CEVENTSYSTEM_H_

#include <list>
#include <map>
using std::multimap;
using std::pair;
using std::list;

#include "CEvents.h"
#include "IListener.h"


class CEventSystem
{
private:
	multimap<EVENTID, IListener* > m_EventsDatabase;
	list<CEvents> m_CurrEvents;

	void DispatchEvents( CEvents* pEvents );
	bool RegisteredEvents( EVENTID eventsID, IListener* pTheListener );

	CEventSystem( void ){ }
	CEventSystem( const CEventSystem& );
	CEventSystem& operator=( const CEventSystem& );
	~CEventSystem( void ){ }
	
public:
	static CEventSystem* GetInstance( void );
	void RegisterListeners( EVENTID eventsID, IListener* pTheListener );
	void UnregisterListeners( EVENTID eventsID, IListener* pTheListener );
	void ClearAllListeners( IListener* pTheListener );
	void SendEvents( EVENTID eventsID, void* pData = NULL );
	void ProcessEvents( void );
	void ClearEvents( void );
	void ShutdownEventSystem( void );
};
#endif 